


<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

    <title>Support &#8212; CVX Users&#39; Guide</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/cloud.css" />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noticia+Text:400,i,b,bi|Open+Sans:400,i,b,bi|Roboto+Mono:400,i,b,bi&amp;display=swap" type="text/css" />
    
    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="_static/doctools.js"></script>

    
    
     
        <script src="_static/jquery.cookie.js"></script>
    

    
     
        <script src="_static/cloud.base.js"></script>
    

    
     
        <script src="_static/cloud.js"></script>
    

    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Advanced topics" href="advanced.html" />
    <link rel="prev" title="Reference guide" href="funcref.html" /> 
        <meta name="viewport" content="width=device-width, initial-scale=1">
  </head><body>
    <div class="relbar-top">
        
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="advanced.html" title="Advanced topics"
             accesskey="N">next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="funcref.html" title="Reference guide"
             accesskey="P">previous</a> &nbsp; &nbsp;</li>
    <li><a href="index.html">CVX Users&#39; Guide</a> &#187;</li>

        <li class="nav-item nav-item-this"><a href="">Support</a></li> 
      </ul>
    </div>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="support">
<span id="id1"></span><h1>Support<a class="headerlink" href="#support" title="Permalink to this heading">¶</a></h1>
<p>Paid CVX Professional users will receive support through a trouble-ticket support system,
so that they can have confidence that their issues are being addressed promptly.</p>
<p>Unfortunately, the user base for CVX has grown to such an extent that its authors simply can
no longer provide support for the free version of CVX. Therefore, we
have created several avenues for obtaining support.</p>
<p>For help on how to <em>use</em> CVX, this users’ guide is your first line of support.
Please make sure that you have attempted to find an answer to your question
here before you pursue other avenues. We have placed this document
<a class="reference external" href="http://cvxr.com/cvx/doc">online</a> and made it searchable in order to
help you find the answers to the questions you may have.</p>
<p>With a package like CVX that encapsulates such mathematical complexity, it can sometimes
be unclear if a problem with a model is due to model formulation or a bug in CVX. See
<a class="reference internal" href="#whatbug"><span class="std std-ref">What is a bug?</span></a> below to help you discern the difference,
and to determine the most appropriate channel for support.</p>
<section id="the-cvx-forum">
<h2>The CVX Forum<a class="headerlink" href="#the-cvx-forum" title="Permalink to this heading">¶</a></h2>
<p>If your answers cannot be found here, consider posting your question
to the <a class="reference external" href="http://ask.cvxr.com">CVX Forum</a>. This is a community forum
that allows our users to submit questions and to answer other people’s questions.
The forum uses the open-source <a class="reference external" href="http://www.askbot.com">Askbot</a> system, and its format
should be familiar to anyone who participates in <a class="reference external" href="http://www.or-exchange.com">OR-Exchange</a>,
<a class="reference external" href="http://stackoverflow.com">Stack Overflow</a>, or any one of the <a class="reference external" href="http://stackexchange.com">Stack Exchange</a>
family of sites.</p>
<p>We highly encourage our expert users who enjoy helping others to participate in
this forum. We hope that it will not only serve as a resource for diagnosing problems
and issues, but a clearinghouse for advanced usage tips and tricks.</p>
</section>
<section id="bug-reports">
<h2>Bug reports<a class="headerlink" href="#bug-reports" title="Permalink to this heading">¶</a></h2>
<p>If you believe you have found a <em>bug</em> in CVX or in one of the underlying solvers,
then we encourage you to submit a bug report—either by email to
to <code class="docutils literal notranslate"><span class="pre">cvx&#64;cvxr.com</span></code> or through our
<a class="reference external" href="http://support.cvxr.com">web-based support portal</a>. Please include the following in your
bug report so we can fully reproduce the problem:</p>
<ol class="arabic simple">
<li><p>the CVX model and supporting data that caused the error.</p></li>
<li><p>a copy of any error messages that it produced</p></li>
<li><p>the CVX version number and build number</p></li>
<li><p>the version number of Matlab that you are running</p></li>
<li><p>the name and version of the operating system you are using</p></li>
</ol>
<p>The easiest way to supply items 3-5 is to type <code class="docutils literal notranslate"><span class="pre">cvx_version</span></code> at the command
prompt and copy its output into your email message.</p>
<p>Please note that we do not own all of Matlab’s toolboxes. We cannot debug a model that
employs functions from a toolbox we do not own.</p>
</section>
<section id="what-is-a-bug">
<span id="whatbug"></span><h2>What <em>is</em> a bug?<a class="headerlink" href="#what-is-a-bug" title="Permalink to this heading">¶</a></h2>
<p>Certain issues are unambiguously bugs, and you should feel free to report them
immediately. In particular, CVX often attempts to catch unexpected errors in key
places—including <code class="docutils literal notranslate"><span class="pre">cvx_setup</span></code>, <code class="docutils literal notranslate"><span class="pre">cvx_end</span></code>, etc. It will report those errors and
instruct you to report them to us. If your model produces a MATLAB error that CVX
did not itself generate, and you cannot readily tie it to a syntax error in your
model, please report that as well.</p>
<p>That said, because disciplined convex programming is a new concept for many, we often
receive support requests for problems with their models that are not, in fact, bugs.
A particularly common class of support requests are reports of models being rejected
due to <code class="docutils literal notranslate"><span class="pre">Disciplined</span></code> <code class="docutils literal notranslate"><span class="pre">convex</span></code> <code class="docutils literal notranslate"><span class="pre">programming</span></code> <code class="docutils literal notranslate"><span class="pre">error</span></code> messages. For instance,
the following code</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>variable x(10)
norm(x) == 1
</pre></div>
</div>
<p>will produce this error in CVX:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Error using cvxprob/newcnstr (line 181)
Disciplined convex programming error:
  Invalid constraint: {convex} == {real constant}
</pre></div>
</div>
<p>Disciplined convex programming errors indicate that the model fails
to adhere to the rules in the <a class="reference internal" href="dcp.html#dcp"><span class="std std-ref">DCP ruleset</span></a>. In nearly all cases,
this is <em>not</em> a bug, and should not be reported as such. Rather,
the underlying issue falls into one of two categories:</p>
<ol class="arabic">
<li><p>The model is <em>not convex</em> (mixed-integer or otherwise). A model with the
nonlinear equation above would fall squarely in this category. CVX simply
cannot solve such problems. In some cases,
it is possible to transform a problem that is non-convex into one that is convex (for
example, <a class="reference internal" href="gp.html#gp-mode"><span class="std std-ref">geometric programs</span></a>). This has not been the case for any
problem submitted by our users—so far.</p></li>
<li><p>The model <em>is</em> convex, but it is still written in a manner that violates the rules.
For instance, given the same vector <code class="docutils literal notranslate"><span class="pre">x</span></code> above, the constraint</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>sqrt( sum( square( x ) ) ) &lt;= 1
</pre></div>
</div>
<p>is convex, but it violates the ruleset—so it is rejected. However, the
mathematically equivalent form</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>norm( x ) &lt;= 1
</pre></div>
</div>
<p>is acceptable.
If your error is of this type, you will need to find a way to express your
problem in a DCP-compliant manner. We have attempted to supply all of the commonly used
functions that the underlying solvers can support; so if you cannot easily rewrite
your problem using the functions supplied, it may not be possible. If you think this
is a possibility, you may wish to see if the wizards on the
<a class="reference external" href="http://ask.cvxr.com">CVX Forum</a> have suggestions for you.</p>
</li>
</ol>
<p>In rare cases, users have discovered that certain models were rejected with
<code class="docutils literal notranslate"><span class="pre">Disciplined</span></code> <code class="docutils literal notranslate"><span class="pre">convex</span></code> <code class="docutils literal notranslate"><span class="pre">programming</span></code> <code class="docutils literal notranslate"><span class="pre">error</span></code> messages
even though they satisfied the <a class="reference internal" href="dcp.html#dcp"><span class="std std-ref">DCP ruleset</span></a>.
We have not received a bug report of this type in quite a long time, however, so we
suspect our users have helped us iron out these issues.</p>
</section>
<section id="handling-numerical-issues">
<h2>Handling numerical issues<a class="headerlink" href="#handling-numerical-issues" title="Permalink to this heading">¶</a></h2>
<p>No developer likes to tell their customers that their software may not work for them.
Alas, we have no choice. The fact is that we cannot guarantee that CVX will be able to
solve your problem, <em>even if</em> it is formulated properly, even if it avoids the use of
integer or binary variables, even if it is of reasonable size, even if it avoids the use
of our experimental <a class="reference internal" href="advanced.html#successive"><span class="std std-ref">exponential cone support</span></a>.</p>
<p>We blame the solvers—but we must come to their defense, too.
Even the best and most mature solvers will struggle with a particular problem that
seems straightforward. Another solver may have no difficulty with that one, but fail
to find an accurate solution on another. While sometimes these challenges are due
to bugs in the solver’s implementation, quite often it is simply due to limits imposed
by the nature of finite numerical precision computation. And different problems push
those limits to different degrees. So the fact is that no solver is perfect, but
no solver <em>can</em> be.</p>
<p>When we consider <a class="reference internal" href="intro.html#what-is-midcp"><span class="std std-ref">mixed-integer problems</span></a>, the situation is even worse.
Solvers must perform what is effectively an exhaustive search among
the integer variables to determine the correct solution. Yes, there are some intelligent
and innovative ways to speed up that search, and the performance of mixed-integer
solvers has improved dramatically over the years. But there will always be models for
which the exhaustive search will simply take too long.</p>
<p>None of this is much comfort if it is <em>your</em> model the solver is struggling with. Here
are some practical tips if you encounter this problem:</p>
<dl class="simple">
<dt><em>Try a different solver.</em></dt><dd><p>Use the <code class="docutils literal notranslate"><span class="pre">cvx_solver</span></code> command for this. If you are using
Gurobi or MOSEK, don’t hesitate to try one of the free solvers if they are compatible
with your problem.</p>
</dd>
<dt><em>Reduce the precision.</em></dt><dd><p>Consider inserting <code class="docutils literal notranslate"><span class="pre">cvx_precision</span> <span class="pre">medium</span></code> or even
<code class="docutils literal notranslate"><span class="pre">cvx_precision</span> <span class="pre">low</span></code> into your problem to see if that allows the solver to exit
successfully. Of course, if it does succeed, make sure to check the results to see
if they are acceptable for your application. If they are not, consider some of the
other advice here to see if the solvability of your model may be improved.</p>
</dd>
<dt><em>Remove constraints.</em></dt><dd><p>If you think that one or more of the constraints might
not be active at the solution, try removing them. If the solver terminates, you can
confirm that your guess was correct by examining the solution to the modified problem.</p>
</dd>
<dt><em>Add constraints</em>.</dt><dd><p>Consider adding simple bounds to the constraints to reduce the size of
the feasible set. This will sometimes improve the numerical conditioning of the problem.
Make them as tight as you can without impinging on the optimal set. If this modified
problem is successfully solved, check the solution to see if any of the added bounds
are active. If they are, relax them, and try again.</p>
</dd>
<dt><em>Watch for scaling issues.</em></dt><dd><p>Scaling issues are the most vexing problems for numerical
solvers to deal with. Solvers will often re-scale the problem to reduce the dynamic
range of the numerical coefficients, but doing so sometimes leads to undesirable
effects on the solution. It is better to avoid scaling issues during the modeling
process. Don’t mix values of wildly different magnitudes, such as <code class="docutils literal notranslate"><span class="pre">1e-3</span></code>
and <code class="docutils literal notranslate"><span class="pre">1e20</span></code>. Even better, try to avoid any numerical values (both in fixed parameters
and likely values of the variables) that exceed <code class="docutils literal notranslate"><span class="pre">1e8</span></code> in absolute value.</p>
</dd>
<dt><em>Try equivalent reformulations.</em></dt><dd><p>It is quite likely that your model can be expressed
in a variety of different ways. Certainly, you should begin with the most obvious
and natural formulation; but if you encounter numerical issues, a reformulation may
often solve them. One reformulation we highly recommend is to eliminate quadratic
forms; see <a class="reference internal" href="advanced.html#quad-forms"><span class="std std-ref">this section</span></a> for more details.</p>
</dd>
<dt><em>Reach out to the CVX Forum.</em></dt><dd><p>Share your struggles with the
<a class="reference external" href="http://ask.cvxr.com">larger CVX community</a>! Perhaps
they will have concrete suggestions for improving the solvability of your model.</p>
</dd>
</dl>
</section>
<section id="cvx-professional-support">
<h2>CVX Professional support<a class="headerlink" href="#cvx-professional-support" title="Permalink to this heading">¶</a></h2>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
        <p class="logo"><a href="index.html" title="index">
          <img class="logo" src="_static/cvxrlogo.png" alt="Logo"/>
        </a></p><div class="sphinx-toc sphinxlocaltoc">
    <h3><a href="index.html">Page contents</a></h3>
    <ul>
<li><a class="reference internal" href="#">Support</a><ul>
<li><a class="reference internal" href="#the-cvx-forum">The CVX Forum</a></li>
<li><a class="reference internal" href="#bug-reports">Bug reports</a></li>
<li><a class="reference internal" href="#what-is-a-bug">What <em>is</em> a bug?</a></li>
<li><a class="reference internal" href="#handling-numerical-issues">Handling numerical issues</a></li>
<li><a class="reference internal" href="#cvx-professional-support">CVX Professional support</a></li>
</ul>
</li>
</ul>

  </div>
  <div class="sphinxprev">
    <h4>Previous page</h4>
    <p class="topless"><a href="funcref.html"
                          title="Previous page">&larr; Reference guide</a></p>
  </div>
  <div class="sphinxnext">
    <h4>Next page</h4>
    <p class="topless"><a href="advanced.html"
                          title="Next page">&rarr; Advanced topics</a></p>
  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/support.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div><h3>Other links</h3>
<ul class="this-page-menu">
<li><a href="CVX.pdf" target="_blank">Download the PDF</a></li>
<li><a href="http://cvxr.com/cvx">CVX home page</a></li>
</ul>


<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
    
    
        <div class="sidebar-toggle-group no-js">
            
            <button class="sidebar-toggle" id="sidebar-hide" title="Hide the sidebar menu">
                 «
                <span class="show-for-small">hide menu</span>
                
            </button>
            <button class="sidebar-toggle" id="sidebar-show" title="Show the sidebar menu">
                
                <span class="show-for-small">menu</span>
                <span class="hide-for-small">sidebar</span>
                 »
            </button>
        </div>
    
      <div class="clearer"></div>
    </div>
    <div class="relbar-bottom">
        
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="advanced.html" title="Advanced topics"
             >next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="funcref.html" title="Reference guide"
             >previous</a> &nbsp; &nbsp;</li>
    <li><a href="index.html">CVX Users&#39; Guide</a> &#187;</li>

        <li class="nav-item nav-item-this"><a href="">Support</a></li> 
      </ul>
    </div>
    </div>

    <div class="footer" role="contentinfo">
        &#169; Copyright © 2012, CVX Research, Inc..
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.0.2.
    </div>
    <!-- cloud_sptheme 1.4 -->
  </body>
</html>